<?php defined('SYSPATH') or die('No direct script access.');

abstract class Controller_DefaultTemplate extends Controller_Template
{

public $template = 'templates/default';

/**
* Initialize properties before running the controller methods (actions),
* so they are available to our action.
*/
public function before()
{
	// Run anything that need ot run before this.
	parent::before();

	if($this->auto_render === TRUE)
	{
		// Initialize empty values
		$this->template->title = Kohana::$config->load('blog.title');;
		$this->template->meta_keywords = '';
		$this->template->meta_description = '';
		$this->template->meta_copywrite = '';
		$this->template->content = '';
		$this->template->styles = array();
		$this->template->scripts = array();
	}
}

/**
* Fill in default values for our properties before rendering the output.
*/
public function after()
{
	if($this->auto_render)
	{
		// Define defaults
		$styles = array('assets/css/style.css' => 'screen');
		
		// Add defaults to template variables.
		$this->template->styles = array_reverse(array_merge($this->template->styles, $styles));
	}

	// Run anything that needs to run after this.
	parent::after();
}

}

